<?php
/**
 * 后台路由
 */
//region 文章分类
Route::resource('/article-categories','ArticleCategoriesController',[
    'name' => [
        'index'   => 'back.article-categories.index',
        'create'  => 'back.article-categories.create',
        'store'   => 'back.article-categories.store',
        'update'  => 'back.article-categories.update',
        'edit'    => 'back.article-categories.edit',
        'destroy' => 'back.article-categories.destroy',
    ],

]);
Route::post('/article-category-is-enabled','ArticleCategoriesController@isEnable');
//endregion
// region 文章
Route::resource('/article', 'ArticleController',[
    'name' => [
        'index'   => 'back.article.index',
        'create'  => 'back.article.create',
        'store'   => 'back.article.store',
        'update'  => 'back.article.update',
        'edit'    => 'back.article.edit',
        'destroy' => 'back.article.destroy',
    ],
]);

// 文章标签
Route::get("/article-label", "ArticleLabelController@getArticleLabels");
Route::post("/article-label", "ArticleLabelController@addArticleLabel");
Route::get("/article-label/{id}", "ArticleLabelController@getArticleLabel");
Route::put("/article-label/{id}", "ArticleLabelController@updateArticleLabel");
Route::delete("/article-label", "ArticleLabelController@deletedArticleLabels");

Route::get('/operators/manage_center/', 'OperatorsController@manageCenterList');

Route::post('/chekout-category', 'ArticleController@checkoutCategory');
//endregion

Route::post('/login', 'AuthController@login');

// 获取邀请码
Route::get ('/get-invitation-code',"AuthController@getInvitationCode");

Route::get("/salesmen/get_member_list", "SalesmenController@getMemberList");
Route::get("/salesmen/get_operators_list", "SalesmenController@getOperatorsList");
Route::group(['middleware' => 'auth:admin'], function(){
    //城市合伙人
    Route::resource('/partners', 'PartnerController');
    Route::post('/partners/stop/{id}', 'PartnerController@stop');
    //运营商
    Route::post('/operators/stop/{id}', 'OperatorsController@stop');
    Route::post('/operators/examine/{id}', 'OperatorsController@examine');
    Route::get('/operators/examine/', 'OperatorsController@examines');

    Route::resource('/operators', 'OperatorsController');
    //业务员
    Route::resource('/salesmen', 'SalesmenController', ['parameters'=>['salesman'=>'id']]);
    Route::post('/salesmen/stop/{id}', 'SalesmenController@stop');


    //会员管理
    Route::get('/member', 'MemberController@index');
    Route::get('/member/{id}', 'MemberController@show');
    //vip产品
    Route::resource('/products/vip', 'VipProductController');
    Route::get('/put-forward', 'PutForwardController@index');
    Route::get('/forward', 'PutForwardController@forward');
    Route::get('/profit', 'ProfitController@index');
    // 统计
    Route::get('/income-count', 'IncomeCountController@index');
    // 加盟申请列表
    Route::get('/list', 'CanvassBusinessController@list');

    // 企业信息
    Route::get('/list', 'CanvassBusinessController@list');

    //互推圈
    Route::get('interpush/report', 'InterPushController@report');
    Route::post('interpush/report_already', 'InterPushController@report_already');
    Route::get('interpush/report_share_content', 'InterPushController@report_share_content');
    Route::get('interpush/report_wechat', 'InterPushController@report_wechat');
    Route::get('media/account', 'MediaController@index');
    Route::get('media/account/info/{id}', 'MediaController@media_user_info');
    Route::post('media/account/adopt/{id}', 'MediaController@adopt');
    Route::post('media/account/reject/{id}', 'MediaController@reject');
    Route::post('media/account/block/{id}', 'MediaController@block');
    Route::post('media/account/unseal/{id}', 'MediaController@unseal');

    // 公司
    Route::get('enterprise/list', 'EnterpriseController@list');
    // 获取城市、运营、业务员下面的企业列表
    Route::get('enterprise/sub', 'EnterpriseController@sub');
    // 获取企业下面的员工个数
    Route::get('enterprise/count_staff', 'EnterpriseController@count_staff');
    // 获取企业下面的会员个数
    Route::get('enterprise/count_user', 'EnterpriseController@count_user');
    Route::get('enterprise/under', 'EnterpriseController@under');
    Route::get('/financial/income', 'FinancialController@income');
    Route::get('/financial/distribution', 'FinancialController@distribution');
    Route::get('/financial/agent', 'FinancialController@agent');
    Route::get('/financial/commission', 'FinancialController@commission');
    Route::get('/financial/lx', 'FinancialController@lx');
    Route::get('/financial/cash', 'FinancialController@cash');
    // 会员转变业务员
    Route::post('/user-change/user-to-salesmen', 'UserChangeController@userToSalesmen');
    // 业务员转变会员
    Route::post('/user-change/salesmen-to-user', 'UserChangeController@SalesmenToUser');
});

Route::post('reset', 'AuthController@reset');

Route::get('/finance','FinanceController@index');
Route::post('/personal_page/template','PageTemplateController@add_template');
Route::post('/custom/component','PageTemplateController@add_custom_component');
Route::put('/custom/component/{id}','PageTemplateController@edit_custom_component');
Route::put('/personal_page/template/{id}','PageTemplateController@edit_template');
Route::delete('/personal_page/template/{id}','PageTemplateController@del_template');
Route::post('/personal_page/category','PageTemplateController@add_category');
Route::post('/custom/category','PageTemplateController@add_custom_category');
Route::delete('/custom/component/{id}','PageTemplateController@del_custom_component');

//Route::get('/user-change/aa', 'UserChangeController@aa');